<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="java.io.*"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>RetrieveValueSets</title>
</head>
<body>
<!-- OID: <b><%= request.getParameter("id") %></b>
<br>
Version: <b><%= request.getParameter("version") %></b>
-->

<%
    if (request.getParameter("id") == null) {
        out.println("Bitte eine OID mitgeben!");
    } else {
        out.println("OID: <b>"+request. getParameter("id")+"</b>");
    }
%>


<%
String str = "print me";
//always give the path from root. This way it almost always works.
String nameOfTextFile = "/Users/manuel/Downloads/imp.txt";
try {   
    PrintWriter pw = new PrintWriter(new FileOutputStream(nameOfTextFile));
    pw.println(str);
    //clean up
    pw.close();
    out.println("<a href=" + nameOfTextFile + ">Download</a>");
} catch(IOException e) {
   out.println(e.getMessage());
}
%>

</body>
</html>